<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="/styles/general.css"/>
<link rel="stylesheet" type="text/css" href="/styles/main.css" />
<link rel="stylesheet" type="text/css" href="/styles/validator.css"></link>
<link rel="stylesheet" href="/themes/custom-theme/jquery.ui.all.css">
<script src="/js/common.js" type="text/javascript"></script>
<script src="/js/jquery-1.7.2.min.js" type="text/javascript"></script>
<script src="/js/ui/jquery.ui.core.js" type="text/javascript"></script>
<script src="/js/ui/jquery.ui.widget.js" type="text/javascript"></script>
<script src="/js/ui/jquery.ui.tabs.js" type="text/javascript"></script>
<script src="/js/formValidator.js" type="text/javascript"></script>
<script src="/js/formValidatorRegex.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
	$( "#tabs" ).tabs();
	$.formValidator.initConfig({formid:"myform",onerror:function(msg){alert(msg)}});
	$("#projectname").formValidator({onshow:"请输入项目名称",onfocus:"请至少要输入1个字符",oncorrect:"OK",defaultvalue:""}).inputValidator({min:1,onerror:"长度不正确,请确认"});
	$("#projectid").formValidator({onshow:"请输入项目编号",onfocus:"请至少要输入1个字符",oncorrect:"OK",defaultvalue:""}).inputValidator({min:1,onerror:"长度不正确,请确认"});
	$("#customername").formValidator({onshow:"请输入客户名称",onfocus:"请至少要输入1个字符",oncorrect:"OK",defaultvalue:""}).inputValidator({min:1,onerror:"长度不正确,请确认"});
	$("#customercode").formValidator({onshow:"请输入客户代码",onfocus:"请至少要输入1个字符",oncorrect:"OK",defaultvalue:""}).inputValidator({min:1,onerror:"长度不正确,请确认"});
	$("#startdate").formValidator({onshow:"请输入开始时间",onfocus:"请至少要输入1个字符",oncorrect:"OK",defaultvalue:""}).inputValidator({min:1,onerror:"长度不正确,请确认"});
	$("#enddate").formValidator({onshow:"请输入结束时间",onfocus:"请至少要输入1个字符",oncorrect:"OK",defaultvalue:""}).inputValidator({min:1,onerror:"长度不正确,请确认"});
	//$("#department").formValidator({onshow:"请输入负责部门",onfocus:"请至少要输入1个字符",oncorrect:"OK",defaultvalue:""}).inputValidator({min:1,onerror:"长度不正确,请确认"});
	//$("#dutyperson").formValidator({onshow:"请输入负责人",onfocus:"请至少要输入1个字符",oncorrect:"OK",defaultvalue:""}).inputValidator({min:1,onerror:"长度不正确,请确认"});
	$("#department").bind('change', function(event) {
	  $.getJSON("/admin/adminjson/deptid/"+$(this).attr("value"),function(JSON){  
        $("#dutyperson").empty();  
        $("#members").empty();
        $.each(JSON,function(i,n){ 
            $("<option value="+i+">"+n+"</option>").appendTo("#dutyperson");  
            var selected = "$info['members']".indexOf(","+i+",")>=0 ? "selected":"";
            $("<option value="+i+" "+selected+">"+n+"</option>").appendTo("#members");  
        });  
        $("#dutyperson").val($info['dutyperson']);
      });  
	});
	$("#department").trigger('change');
});
</script>
<title></title>
</head>
<body>
<h1>
<span class="action-span"><a href="/project">管理项目</a></span>
<span class="action-span1">修改项目 </span>
<div style="clear:both"></div>
</h1>
<div class="main-div">
  <form action="/project/modify/" method="post" name="myform" id="myform" enctype="multipart/form-data">
  <div id="tabs">
	<ul>
		<li><a href="#tabs-1">基本信息</a></li>
		<li><a href="#tabs-2">项目文档</a></li>
	</ul>
	<div id="tabs-1">
  <table width="100%" id="general-table">
     <tr>
        <td class="label">项目名称：</td>
        <td>
        	{form hidden * id id $id}
			{form text * projectname projectname $info['projectname']}
        </td>
        <td><div id='projectnameTip' style="width:250px"></div></td>
     </tr>
     <tr>
        <td class="label">项目编号：</td>
        <td>
			{form text * projectid projectid $info['projectid']}
        </td>
        <td><div id='projectidTip' style="width:250px"></div></td>
     </tr>
	 <tr>
        <td class="label">客户名称：</td>
        <td>
			{form text * customername customername $info['customername']}
        </td>
        <td><div id='customernameTip' style="width:250px"></div></td>
      </tr>
      <tr>
        <td class="label">客户代码：</td>
        <td>
			{form text * customercode customercode $info['customercode']}
        </td>
        <td><div id='customercodeTip' style="width:250px"></div></td>
     </tr>
     <tr>
        <td class="label">开始时间：</td>
        <td>
			{form datetime * startdate startdate $info['startdate']}
        </td>
        <td><div id='startdateTip' style="width:250px"></div></td>
     </tr>
     <tr>
        <td class="label">结束时间：</td>
        <td>
			{form datetime * enddate enddate $info['enddate']}
        </td>
        <td><div id='enddateTip' style="width:250px"></div></td>
     </tr>
     <tr>
        <td class="label">负责部门：</td>
        <td>
			{form select * department department $info['department'] * * $deptsList}
        </td>
        <td><div id='departmentTip' style="width:250px"></div></td>
     </tr>
     <tr>
        <td class="label">负责人：</td>
        <td>
			{form select * dutyperson dutyperson $info['dutyperson']}
        </td>
        <td><div id='dutypersonTip' style="width:250px"></div></td>
     </tr>
     <tr>
        <td class="label">项目成员：</td>
        <td>
			{form multiple * members members $info['members'] * 10}
        </td>
        <td><div id='membersTip' style="width:250px"></div></td>
      </tr>
      <tr>
        <td class="label">目标化合物：</td>
        <td>
			{form text * goalcompound goalcompound  $info['goalcompound']}
        </td>
        <td><div id='goalcompoundTip' style="width:250px"></div></td>
      </tr>
       <tr>
        <td class="label">是否公开：</td>
        <td>
			{form radio * ispublic ispublic $info['ispublic']}
        </td>
        <td><div id='publicTip' style="width:250px"></div></td>
      </tr>
      <tr>
        <td class="label">工作流：</td>
        <td>
			{form radio * workflow workflow $info['workflow'] * * $workflowList}
        </td>
        <td><div id='workflowTip' style="width:250px"></div></td>
      </tr>
  </table>
  	</div>
  	<div id="tabs-2"  style="padding:0 0 0 2px">
  		<iframe width="100%" scrolling-x="no" scrolling-y="auto" height="400px" frameborder ="0" src="/projectdoc/index/projectid/$id" ></iframe>
  	</div>
  	</div>
   <div class="button-div">
        <input type="submit" value="&nbsp;确&nbsp;定&nbsp;" />
        &nbsp;&nbsp;&nbsp;&nbsp;
        <input type="reset" value="&nbsp;重&nbsp;置&nbsp;" />
   </div>
      
  </form>
</div>
{template 'footer.html'}
</body>
</html>